package com.youlv.yl.controller;


import com.youlv.yl.bo.ShopCategoryBo;
import com.youlv.yl.service.intf.ShoppingService;

import com.youlv.yl.vo.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;



@RestController
@RequestMapping("/api/shopping/")
@Api(value = "实现商店相关操作", tags = "实现商店相关操作")
@CrossOrigin
public class ShoppingController {

    @Autowired
    private ShoppingService shoppingService;

    @GetMapping("allshops.do")
    public R getAllShops(String sname){

        return shoppingService.getAllShops(sname);
    }

    @GetMapping("shopDetail.do")
    public R shopDetail(String id){

        return shoppingService.getOneShop(id);
    }

    @PostMapping("countGeo.do")
    public R countGeo(@RequestBody ShopCategoryBo bo){

        return shoppingService.countGeoDistance(bo);
    }
}
